package com.ss.android.article.base.feature.feed.vh;

import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.support.v4.content.ContextCompat;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.TouchDelegate;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.view.ViewTreeObserver;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bytedance.article.common.c.TTUtils;
import com.bytedance.common.utility.Logger;
import com.bytedance.common.utility.UIUtils;
import com.bytedance.common.utility.collection.WeakList;
import com.ss.android.account.Spipe;
import com.ss.android.action.ArticleActionHelper;
import com.ss.android.action.b.FeedViewHolder;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.feature.app.a.ArticleConstants;
import com.ss.android.article.base.feature.app.b.DBHelper;
import com.ss.android.article.base.feature.c.FeedItemBehavior;
import com.ss.android.article.base.feature.feed.FeedCellStyleConfig;
import com.ss.android.article.base.feature.feed.activity.InfoLayout;
import com.ss.android.article.base.feature.feed.activity.NewInfoLayout;
import com.ss.android.article.base.feature.feed.FeedOnMovedToScrapHeapListener;
import com.ss.android.article.base.feature.model.Article;
import com.ss.android.article.base.feature.model.CellRef;
import com.ss.android.article.base.feature.video.IVideoControllerContext;
import com.ss.android.article.base.ui.AdButtonLayout;
import com.ss.android.article.base.ui.DiggLayout;
import com.ss.android.article.base.ui.DrawableButton;
import com.ss.android.article.base.ui.DuplicatePressedRelativeLayout;
import com.ss.android.article.base.ui.ForeGroundImageView;
import com.ss.android.article.base.ui.GridImageLayout;
import com.ss.android.article.base.ui.LargeVideoGrayAreaLayout;
import com.ss.android.article.browser.R;
import com.ss.android.article.common.NightModeAsyncImageView;
import com.ss.android.common.util.NetworkStatusMonitor;
import com.ss.android.image.AsyncImageView;
import com.ss.android.j.ClickableBackgroundCompat;
import com.ss.android.newmedia.a.TimeFormatter;

import java.util.ArrayList;
import java.util.Iterator;

public class BaseFeedViewHolder extends FeedViewHolder implements FeedOnMovedToScrapHeapListener {
    public final class AdLayoutHolder {
        public RelativeLayout mAdActionBtnLayout;
        public ImageView mActionAdIcon;
        public TextView mActionAdTv;
        public ProgressBar mActionAdProgress;
        public View mActionAdDivider;
        public TextView mActionAdInfoLayout;
        public ViewGroup mAppAdInfoLayout;
        public TextView mAdNameTv;
        public TextView mAdDetailInfoTv;
        public ViewGroup mAdDownloadProgressLayout;
        public TextView mAdDownloadSize;
        public TextView mAdDownloadStatus;
        public ProgressBar mAdDownloadProgress;
        public ViewGroup mLbsAdInfoLayout;
        public TextView mLbsAdAddressInfoTv;
        public TextView mLbsAdCurrentPriceTv;
        public TextView mLbsAdOriginPriceTv;
        public TextView mLbsAdSoldNumberTv;
    }

    public static final class MoreCommentsDiggInfoLayoutHolder {
        public ViewGroup mMoreCommentsDiggInfoLayout;
        public TextView mVideoTitle;
        public DiggLayout mMultiVideoDiggLayout;
        public DiggLayout mMultiVideoBuryLayout;
        public ViewGroup mCommentWrapper;
        public TextView mComment;
        public ImageView mMore;
        public View mDividerLine;
        public View mDividerSpace;
        public LinearLayout mCommentsWrapper;
        public ArrayList k = new ArrayList(0);
        private static final WeakList l = new WeakList();

        public static TextView a(Context arg6) {
            TextView v0_1;
            TextView v0;
            Object v1 = null;
            int v5 = R.color.ssxinzi3;
            int v4 = -2;
            WeakList v2 = l;
            if (v2.weakHashMap.size() == 0) {
                v0 = null;
            } else {
                Iterator v3 = v2.weakHashMap.keySet().iterator();
                do {
                    if (v3.hasNext()) {
                        v0 = (TextView) v3.next();
                        if (v0 == null) {
                            continue;
                        }
                    } else {
                        v0 = null;
                    }
                    break;
                }
                while (true);
                v2.weakHashMap.remove(v0);
            }

            if (v0 == null) {
                v0 = new TextView(arg6.getApplicationContext());
                v0.setTextSize(12f);
                v0.setLineSpacing(UIUtils.dp2px(arg6, 5f), 1f);
                v0.setMaxLines(3);
                v0.setEllipsize(TextUtils.TruncateAt.END);
                AppData.getInstance();
                AppData.isNightMode();
                v0.setTextColor(ContextCompat.getColorStateList(arg6, v5));
                v0.setLayoutParams(new LinearLayout.LayoutParams(v4, v4));
            } else {
                AppData.getInstance();
                AppData.isNightMode();
                v0.setTextColor(ContextCompat.getColorStateList(arg6, v5));
            }

            return v0;
        }

        public static void a(MoreCommentsDiggInfoLayoutHolder holder) {
            int childCount = holder.mCommentsWrapper.getChildCount();
            if (childCount > 0) {
                for (int i = childCount - 1; i >= 0; --i) {
                    View child = holder.mCommentsWrapper.getChildAt(i);
                    holder.mCommentsWrapper.removeViewAt(i);
                    l.add(child);
                }
                holder.k.clear();
            }
        }
    }

    public ViewGroup mContentContainer;
    public TextView mImage3Title;
    public View mDeleteTextView;
    public ImageView mDivider;
    public LinearLayout mTopSourceLayout;
    public ForeGroundImageView mTopSourceIcon;
    public TextView mTopSourceIconTv;
    public TextView mTopSourceText;
    public ViewGroup mImage1Container;
    public TextView mImage1Title;
    public DrawableButton mRightVideoTime;
    public AsyncImageView mImage1ImageView;
    public ViewGroup mImage1LeftContainer;
    public TextView mRightComment;
    public ViewGroup mAbstractCommentLayout;
    public TextView mItemAbstract;
    public TextView mCommentContent;
    public InfoLayout mImage3InfoLayout;
    public ViewStub mNewInfoLayoutStub;
    public NewInfoLayout mNewInfoLayout;
    public InfoLayout mImage1InfoLayout;
    public InfoLayout mRightInfoLayoutGroup;
    public View mImage3ImageContainerView;
    public AsyncImageView mImage3FirstImageView;
    public AsyncImageView mImage3SecondImageView;
    public AsyncImageView mImage3ThirdImageView;
    public TextView mActionAdTv;
    public ProgressBar mActionAdProgress;
    public View mActionAdDivider;
    public TextView mActionAdInfoLayout;
    public ViewGroup mAppAdInfoLayout;
    public TextView mAdNameTv;
    public TextView mAdDetailInfoTv;
    public ViewGroup mAdDownloadProgressLayout;
    public TextView mAdDownloadSize;
    public TextView mAdDownloadStatus;
    public ProgressBar mAdDownloadProgress;
    public ViewGroup mLbsAdInfoLayout;
    public TextView mLbsAdAddressInfoTv;
    public TextView mLbsAdCurrentPriceTv;
    public TextView mLbsAdOriginPriceTv;
    public TextView mLbsAdSoldNumberTv;
    public ViewGroup mVideoCoverLayout;
    public TextView mCoverTitle;
    public TextView mCoverSource;
    public DrawableButton mCoverDuration;
    public ImageView mCoverPlayIcon;
    public View mCoverTopShaow;
    public View mCoverBottomShaow;
    public AdButtonLayout mCoverButtonAd;
    public DiggLayout mDiggLayout;
    public DiggLayout mBuryLayout;
    public ViewGroup mLargeImageLayout;
    public ViewGroup mRelatedVideoContainer;
    public AsyncImageView mLargeImage;
    public ImageView mLargeImageVideoPlay;
    public LargeVideoGrayAreaLayout mLargeImageVideoGrayArea;
    public DrawableButton mLargeVideoTime;
    public AdButtonLayout mLargeButtonAd;
    public View mDiggInfoLayout;
    public View mNoDiggInfoLayout;
    public ViewGroup mLargeImageAdInfoLayout;
    public ViewGroup mRightImageAdLayout;
    public ViewGroup mRightImageAdCreativityLayout;
    public ViewGroup mImage3ImageContainer;
    public AsyncImageView mRightImageAdImage;
    public RelativeLayout mRightImageAdImageLayout;
    public TextView mRightImageAdImageTagIcon;
    public TextView mRightImageAdTitle;
    public ViewGroup mLargeImageAdInfoLayout_AdInfoLayout;
    public ViewGroup mRightImageAdLayout_AdInfoLayout;
    public LinearLayout mRightImageAdInfoLayout;
    public ViewGroup mCreativityAdInfoLayout;
    public AdLayoutHolder mLargeImageAdInfoAdLayoutHolder;
    public AdLayoutHolder mRightImageAdLayoutHolder;
    public AdLayoutHolder mCreativityAdInfoLayoutHolder;
    public RelativeLayout mAdActionBtnLayout;
    public ImageView mActionAdIcon;
    public ViewGroup mVideoSwitchInfosLayout;
    public ViewGroup mHeadNameInfosLayout;
    public ImageView mSwitchAvatar;
    public TextView mSwitchName;
    public DiggLayout mSwitchVideoDigg;
    public DiggLayout mSwitchVideoBury;
    public DrawableButton mSwitchVideoCommentCount;
    public DrawableButton mSwitchVideoAction;
    public ViewGroup mVideoSwitchSourceInfosLayout;
    public TextView mSwitchSource;
    public TextView mCommentCount;
    public TextView mVideoDuration;
    protected Context context;
    protected AppData mAppData;
    protected final Resources resources;
    protected final NetworkStatusMonitor networkMonitor;
    protected final ArticleActionHelper articleActionHelper;
    protected final FeedItemBehavior mFeedItemBehavior;
    protected IVideoControllerContext videoControllerContext;
    public CellRef mCellRef;
    public int mPosition = -1;
    public boolean mIsNightMode = false;
    protected int mFeedType;
    protected final int maxLargeImageHeight;
    protected final int actualLargeImageWidth;
    protected final int mImageViewWidth;
    public TextView mCoverActionCommentCount;
    public ImageView mCoverActionReport;
    public TextView mVideoSourceInNoDigg;
    public TextView mVideoDurationInNoDigg;
    public TextView mVideoCommentInNoDigg;
    public ImageButton mVideoRepostInNoDigg;
    public AsyncImageView[] mImage3ImageViews;
    MoreCommentsDiggInfoLayoutHolder mMoreCommentsDiggInfoLayoutHolder;
    public ViewGroup mGridImageLayout;
    public TextView mGridLayoutTitle;
    public GridImageLayout gridImageLayout;
    public ViewGroup mEntityLayout;
    public TextView mEntityDesc;
    public View mEntityDivider;
    public TextView mEntityLike;
    public ImageView mEntityArrow;
    public ViewGroup mDiggAuthorVideoLayout;
    public ViewGroup mAuthorAvatarWrapper;
    public ImageView mAuthorAvatar;
    public TextView mAuthorName;
    public TextView mAuthorVideoWatchCount;
    public DiggLayout mAuthorVideoDiggLayout;
    public DiggLayout mAuthorVideoBuryLayout;
    public TextView mAuthorVideoCommentCount;
    public View mAuthorDivider;
    public ImageView mAuthorVideoAction;
    protected final int mImageViewHeight;
    private ViewTreeObserver.OnPreDrawListener onPreDrawListener = new ViewTreeObserver.OnPreDrawListener() {

        public final boolean onPreDraw() {
            mContentContainer.getViewTreeObserver().removeOnPreDrawListener(((ViewTreeObserver.OnPreDrawListener) this));
            ImageView v0 = null;
            if (mImage3InfoLayout == null || mImage3InfoLayout.getVisibility() != View.VISIBLE || mImage3InfoLayout.mDislikeIcon == null || mImage3InfoLayout.mDislikeIcon.getVisibility() != View.VISIBLE) {
                if (mImage1InfoLayout != null && mImage1InfoLayout.getVisibility() == View.VISIBLE && mImage1InfoLayout.mDislikeIcon != null && mImage1InfoLayout.mDislikeIcon.getVisibility() == View.VISIBLE) {
                    v0 = mImage1InfoLayout.mDislikeIcon;
                } else if (mRightInfoLayoutGroup == null) {
                } else if (mRightInfoLayoutGroup.getVisibility() != View.VISIBLE) {
                } else if (mRightInfoLayoutGroup.mDislikeIcon == null) {
                } else if (mRightInfoLayoutGroup.mDislikeIcon.getVisibility() != View.VISIBLE) {
                } else {
                    v0 = mRightInfoLayoutGroup.mDislikeIcon;
                }
            } else {
                v0 = mImage3InfoLayout.mDislikeIcon;
            }

            if (v0 != null) {
                int[] v1 = UIUtils.a(((View) v0), mContentContainer);
                if (v1 != null) {
                    Rect v2 = new Rect();
                    int v3 = ((int) UIUtils.dp2px(context, 10f));
                    int v4 = ((int) UIUtils.dp2px(context, 5f));
                    v2.left = v1[0] - v3;
                    v2.top = v1[1] - v3;
                    v2.right = v4 + (v1[0] + v0.getWidth());
                    v2.bottom = v1[1] + v0.getHeight() + v3;
                    mContentContainer.setTouchDelegate(new TouchDelegate(v2, v0));
                }
            }

            return true;
        }
    };
    private ViewGroup mImage1RightContainer;
    private View mCommentLeftTip;
    private InfoLayout mRightInfoLayoutGroup2;
    private LinearLayout mRightImageAdTitleLayout;
    private int mSourceIconHeight;
    private int mSourceIconMaxWidth;
    private boolean bindData;
    private TimeFormatter timeFormatter;
    private ColorFilter colorFilter;
    private Typeface typeface;
    protected static ForegroundColorSpan foregroundColorSpan;
    public DuplicatePressedRelativeLayout duplicatePressedRelativeLayout;

    public BaseFeedViewHolder(Context context,
                              NetworkStatusMonitor networkMonitor,
                              FeedItemBehavior feedItemBehavior,
                              ArticleActionHelper articleActionHelper,
                              int feedType,
                              TimeFormatter timeFormatter,
                              int actualItemImageWidth,
                              int actualItemImageHeight,
                              int actualLargeImageWidth,
                              int maxLargeImageHeight) {
        this.context = context;
        this.mFeedItemBehavior = feedItemBehavior;
        this.mFeedType = feedType;
        this.networkMonitor = networkMonitor;
        Spipe.inst();
        this.mAppData = AppData.getInstance();
        this.resources = this.context.getResources();
        this.articleActionHelper = articleActionHelper;
        this.timeFormatter = timeFormatter;
        this.mImageViewWidth = actualItemImageWidth;
        this.mImageViewHeight = actualItemImageHeight;
        this.actualLargeImageWidth = actualLargeImageWidth;
        this.mSourceIconHeight = context.getResources().getDimensionPixelSize(R.dimen.hp);
        this.mSourceIconMaxWidth = context.getResources().getDimensionPixelSize(R.dimen.hq);
        this.maxLargeImageHeight = maxLargeImageHeight;
        if ((this.context instanceof IVideoControllerContext)) {
            this.videoControllerContext = (IVideoControllerContext) this.context;
        }
    }

    protected final boolean A() {
        boolean v0;
        switch (this.mFeedType) {
            case 1: {
                v0 = true;
                break;
            }
            default: {
                v0 = false;
                break;
            }
        }

        return v0;
    }

    protected final boolean B() {
        boolean v0;
        switch (this.mFeedType) {
            case 1: {
                v0 = true;
                break;
            }
            default: {
                v0 = false;
                break;
            }
        }

        return v0;
    }

    protected final void initVideoCoverLayout() {
        if (this.mVideoCoverLayout == null) {
            this.mVideoCoverLayout = (ViewGroup) ((ViewStub) this.mLargeImageLayout.findViewById(R.id.video_cover_layout_stub)).inflate();
            this.mCoverDuration = this.mVideoCoverLayout.findViewById(R.id.cover_duration);
            this.mCoverDuration.a();
            this.mCoverPlayIcon = this.mVideoCoverLayout.findViewById(R.id.cover_play_icon);
            this.mCoverSource = this.mVideoCoverLayout.findViewById(R.id.cover_source);
            this.mCoverTitle = this.mVideoCoverLayout.findViewById(R.id.cover_title);
            this.mCoverTopShaow = this.mVideoCoverLayout.findViewById(R.id.cover_top_shaow);
            this.mCoverBottomShaow = this.mVideoCoverLayout.findViewById(R.id.cover_bottom_shaow);
            this.mCoverButtonAd = this.mVideoCoverLayout.findViewById(R.id.cover_button_ad);
            if (this.mIsNightMode) {
                this.adaptVideoCoverLayoutNightMode();
            }
        }
    }

    protected final void initDiggAuthorVideoLayout() {
        if (this.mDiggAuthorVideoLayout == null) {
            this.mDiggAuthorVideoLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.digg_author_video_layout_stub)).inflate();
            this.mAuthorAvatar = this.mDiggAuthorVideoLayout.findViewById(R.id.author_avatar);
            this.mAuthorName = this.mDiggAuthorVideoLayout.findViewById(R.id.author_name);
            this.mAuthorVideoDiggLayout = this.mDiggAuthorVideoLayout.findViewById(R.id.author_video_digg_layout);
            this.mAuthorAvatarWrapper = this.mDiggAuthorVideoLayout.findViewById(R.id.author_avatar_wrapper);
            this.mAuthorVideoBuryLayout = this.mDiggAuthorVideoLayout.findViewById(R.id.author_video_bury_layout);
            this.mAuthorVideoCommentCount = this.mDiggAuthorVideoLayout.findViewById(R.id.author_video_comment_count);
            this.mAuthorDivider = this.mDiggAuthorVideoLayout.findViewById(R.id.divider);
            this.mAuthorVideoAction = this.mDiggAuthorVideoLayout.findViewById(R.id.author_video_action);
            this.mAuthorVideoWatchCount = this.mDiggAuthorVideoLayout.findViewById(R.id.author_video_watch_count);
            UIUtils.setLayoutParams(this.mAuthorVideoCommentCount, UIUtils.percentWidth(this.context, 0.1875f), -3);
            int width = UIUtils.percentWidth(this.context, 0.0625f);
            UIUtils.setLayoutMargins(this.mAuthorVideoDiggLayout, -3, -3, width, -3);
            UIUtils.setLayoutMargins(this.mAuthorVideoBuryLayout, -3, -3, width, -3);
            if (this.mIsNightMode) {
                this.adaptDiggAuthorVideoLayoutNightMode();
            }
        }
    }

    protected final void initLargeImageLayout() {
        if (this.mLargeImageLayout == null) {
            this.mLargeImageLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.large_image_layout_stub)).inflate();
            this.mLargeImage = this.mLargeImageLayout.findViewById(R.id.large_image);
            this.mLargeImageVideoPlay = this.mLargeImageLayout.findViewById(R.id.large_image_video_play);
            this.mLargeImageVideoGrayArea = this.mLargeImageLayout.findViewById(R.id.large_image_video_gray_area);
            this.mLargeVideoTime = this.mLargeImageLayout.findViewById(R.id.large_video_time);
            this.mLargeVideoTime.a();
            this.mRelatedVideoContainer = this.mLargeImageLayout.findViewById(R.id.related_video_container);
            this.mLargeButtonAd = this.mLargeImageLayout.findViewById(R.id.large_button_ad);
            if (this.mIsNightMode) {
                this.adaptLargeImageLayoutNightMode();
            }
        }
    }

    protected final void initLargeImageAdInfoLayout() {
        if (this.mLargeImageAdInfoLayout == null) {
            this.initLargeImageLayout();
            this.mLargeImageAdInfoLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.large_image_ad_info_layout_stub)).inflate();
            this.mLargeImageAdInfoLayout_AdInfoLayout = this.mLargeImageAdInfoLayout.findViewById(R.id.ad_info_layout);
            this.mLargeImageAdInfoAdLayoutHolder = new AdLayoutHolder();
            this.adaptLargeImageAdInfoLayoutNightMode();
        }
    }

    protected final void initRightImageAdLayout() {
        if (this.mRightImageAdLayout == null) {
            this.mRightImageAdLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.right_image_ad_layout_stub)).inflate();
            if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                    UIUtils.setLayoutMargins(this.mRightImageAdLayout, -3, ((int) UIUtils.dp2px(this.context, 8f)), -3, -3);
                } else {
                    UIUtils.setLayoutMargins(this.mRightImageAdLayout, -3, ((int) UIUtils.dp2px(this.context, 10f)), -3, -3);
                }
            }

            this.mRightImageAdTitle = this.mRightImageAdLayout.findViewById(R.id.right_image_ad_title);
            FeedCellStyleConfig.a(this.mRightImageAdTitle, null);
            this.mRightImageAdInfoLayout = this.mRightImageAdLayout.findViewById(R.id.right_image_ad_info_layout);
            this.mRightImageAdTitleLayout = this.mRightImageAdCreativityLayout.findViewById(R.id.right_image_ad_title_layout);
            this.mRightImageAdImage = this.mRightImageAdLayout.findViewById(R.id.right_image_ad_image);
            this.mRightImageAdImageLayout = this.mRightImageAdLayout.findViewById(R.id.right_image_ad_image_layout);
            this.mRightImageAdImageTagIcon = this.mRightImageAdLayout.findViewById(R.id.right_image_ad_image_tag_icon);
            this.mRightImageAdLayout_AdInfoLayout = this.mRightImageAdLayout.findViewById(R.id.ad_info_layout);
            this.mRightInfoLayoutGroup2 = this.mRightImageAdLayout.findViewById(R.id.right_info_layout_group);
            this.mRightImageAdLayoutHolder = new AdLayoutHolder();
            ViewGroup.LayoutParams rightImageAdInfoLayoutLp = this.mRightImageAdInfoLayout.getLayoutParams();
            ViewGroup.LayoutParams rightImageAdTitleLayoutLp = this.mRightImageAdTitleLayout.getLayoutParams();
            ViewGroup.LayoutParams rightImageAdImageLayoutLp = this.mRightImageAdImageLayout.getLayoutParams();
            if (this.mAppData.getAppSettings().isSingleImageGravityChange()) {
                ((RelativeLayout.LayoutParams) rightImageAdInfoLayoutLp).addRule(11);
                ((RelativeLayout.LayoutParams) rightImageAdInfoLayoutLp).addRule(1, R.id.right_image_ad_image_layout);
                ((LinearLayout.LayoutParams) rightImageAdTitleLayoutLp).setMargins(((int) UIUtils.dp2px(this.context, 10f)), 0, 0, 0);
                this.mRightImageAdTitleLayout.setLayoutParams(rightImageAdTitleLayoutLp);
                ((RelativeLayout.LayoutParams) rightImageAdImageLayoutLp).addRule(9);
                UIUtils.setLayoutMargins(this.mRightInfoLayoutGroup2, ((int) UIUtils.dp2px(this.context, 10f)), ((int) UIUtils.dp2px(this.context, 14f)), -3, -3);
            } else {
                ((RelativeLayout.LayoutParams) rightImageAdInfoLayoutLp).addRule(9);
                ((RelativeLayout.LayoutParams) rightImageAdInfoLayoutLp).addRule(0, R.id.right_image_ad_image_layout);
                ((LinearLayout.LayoutParams) rightImageAdTitleLayoutLp).setMargins(0, 0, ((int) UIUtils.dp2px(this.context, 23f)), 0);
                this.mRightImageAdTitleLayout.setLayoutParams(rightImageAdTitleLayoutLp);
                ((RelativeLayout.LayoutParams) rightImageAdImageLayoutLp).addRule(11);
                UIUtils.setLayoutMargins(this.mRightInfoLayoutGroup2, -3, ((int) UIUtils.dp2px(this.context, 14f)), ((int) UIUtils.dp2px(this.context, 10f)), -3);
            }

            this.adaptRightImageAdLayoutNight();
        }
    }

    protected final void initMultiImageAdLayout() {
        boolean image3;
        if (this.mImage3ImageContainer == null) {
            this.mImage3ImageContainerView = ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.multi_image_ad_layout_stub)).inflate();
            this.mImage3ImageContainer = (ViewGroup) this.mImage3ImageContainerView;
            this.mImage3FirstImageView = this.mImage3ImageContainerView.findViewById(R.id.item_image_0);
            this.mImage3SecondImageView = this.mImage3ImageContainerView.findViewById(R.id.item_image_1);
            this.mImage3ThirdImageView = this.mImage3ImageContainerView.findViewById(R.id.item_image_2);
            this.mImage3ImageViews = new AsyncImageView[3];
            this.mImage3ImageViews[0] = this.mImage3FirstImageView;
            this.mImage3ImageViews[1] = this.mImage3SecondImageView;
            this.mImage3ImageViews[2] = this.mImage3ThirdImageView;
            int length = this.mImage3ImageViews.length;
            for (int i = 0; i < length; i++) {
                ViewGroup.LayoutParams lp = this.mImage3ImageViews[i].getLayoutParams();
                lp.width = this.mImageViewWidth;
                lp.height = this.mImageViewHeight;
            }
            image3 = true;
        } else {
            image3 = false;
        }

        if (this.mCreativityAdInfoLayout == null) {
            this.mCreativityAdInfoLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.creativity_ad_info_layout_stub)).inflate();
            if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                    UIUtils.setLayoutMargins(this.mCreativityAdInfoLayout, -3, -3, -3, ((int) UIUtils.dp2px(this.context, 6f)));
                } else {
                    UIUtils.setLayoutMargins(this.mCreativityAdInfoLayout, -3, -3, -3, ((int) UIUtils.dp2px(this.context, 7f)));
                }
            }

            this.mCreativityAdInfoLayoutHolder = new AdLayoutHolder();
        }
        if (image3) {
            this.adaptImage3ImageNightMode();
        }
    }

    protected final void initRightImageAdImageLayout() {
        float v8 = 14f;
        int v7 = R.id.right_image_ad_image_layout;
        float v6 = 10f;
        int v4 = -3;
        if (this.mRightImageAdCreativityLayout == null) {
            this.mRightImageAdCreativityLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.right_image_ad_creativity_layout_stub)).inflate();
            this.mRightImageAdInfoLayout = this.mRightImageAdCreativityLayout.findViewById(R.id.right_image_ad_info_layout);
            this.mRightImageAdTitleLayout = this.mRightImageAdCreativityLayout.findViewById(R.id.right_image_ad_title_layout);
            this.mRightImageAdTitle = this.mRightImageAdCreativityLayout.findViewById(R.id.right_image_ad_title);
            this.mRightImageAdImage = this.mRightImageAdCreativityLayout.findViewById(R.id.right_image_ad_image);
            this.mRightImageAdImageLayout = this.mRightImageAdCreativityLayout.findViewById(v7);
            this.mRightImageAdImageTagIcon = this.mRightImageAdCreativityLayout.findViewById(R.id.right_image_ad_image_tag_icon);
            this.mRightInfoLayoutGroup = this.mRightImageAdCreativityLayout.findViewById(R.id.right_info_layout_group);
            if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                    UIUtils.setLayoutMargins(this.mRightInfoLayoutGroup, v4, ((int) UIUtils.dp2px(this.context, 5f)), v4, v4);
                    UIUtils.setLayoutMargins(this.mRightImageAdCreativityLayout, v4, ((int) UIUtils.dp2px(this.context, 8f)), v4, v4);
                } else {
                    UIUtils.setLayoutMargins(this.mRightImageAdCreativityLayout, v4, ((int) UIUtils.dp2px(this.context, v6)), v4, v4);
                    UIUtils.setLayoutMargins(this.mRightInfoLayoutGroup, v4, ((int) UIUtils.dp2px(this.context, 6f)), v4, v4);
                }
            }

            this.mRightInfoLayoutGroup.setSourceIconHeight(this.mSourceIconHeight);
            this.mRightInfoLayoutGroup.setSourceIconMaxWidth(this.mSourceIconMaxWidth);
            this.mRightInfoLayoutGroup.setCommonTxtPaintTypeFace(this.typeface);
            this.mRightInfoLayoutGroup.mDislikeIcon.setId(R.id.ay);
            ViewGroup.LayoutParams v0 = this.mRightImageAdInfoLayout.getLayoutParams();
            ViewGroup.LayoutParams v1 = this.mRightImageAdTitleLayout.getLayoutParams();
            ViewGroup.LayoutParams v2 = this.mRightImageAdImageLayout.getLayoutParams();
            if (this.mAppData.getAppSettings().isSingleImageGravityChange()) {
                ((RelativeLayout.LayoutParams) v0).addRule(11);
                ((RelativeLayout.LayoutParams) v0).addRule(1, v7);
                ((LinearLayout.LayoutParams) v1).setMargins(((int) UIUtils.dp2px(this.context, v6)), 0, 0, 0);
                this.mRightImageAdTitleLayout.setLayoutParams(v1);
                ((RelativeLayout.LayoutParams) v2).addRule(9);
                UIUtils.setLayoutMargins(this.mRightInfoLayoutGroup, ((int) UIUtils.dp2px(this.context, v6)), ((int) UIUtils.dp2px(this.context, v8)), v4, v4);
            } else {
                ((RelativeLayout.LayoutParams) v0).addRule(9);
                ((RelativeLayout.LayoutParams) v0).addRule(0, v7);
                ((LinearLayout.LayoutParams) v1).setMargins(0, 0, ((int) UIUtils.dp2px(this.context, 23f)), 0);
                this.mRightImageAdTitleLayout.setLayoutParams(v1);
                ((RelativeLayout.LayoutParams) v2).addRule(11);
                UIUtils.setLayoutMargins(this.mRightInfoLayoutGroup, v4, ((int) UIUtils.dp2px(this.context, v8)), ((int) UIUtils.dp2px(this.context, v6)), v4);
            }
        }

        if (this.mCreativityAdInfoLayout == null) {
            this.mCreativityAdInfoLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.creativity_ad_info_layout_stub)).inflate();
            this.mCreativityAdInfoLayoutHolder = new AdLayoutHolder();
        }
    }

    protected final void initGridImageLayout() {
        if (this.mGridImageLayout == null) {
            this.mGridImageLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.grid_image_layout_stub)).inflate();
            this.mGridLayoutTitle = this.mGridImageLayout.findViewById(R.id.grid_layout_title);
            FeedCellStyleConfig.a(this.mGridLayoutTitle, null);
            if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                    UIUtils.setLayoutMargins(this.mGridLayoutTitle, -3, ((int) UIUtils.dp2px(this.context, 10f)), -3, -3);
                } else {
                    UIUtils.setLayoutMargins(this.mGridLayoutTitle, -3, ((int) UIUtils.dp2px(this.context, 12f)), -3, -3);
                }
            }

            this.gridImageLayout = this.mGridImageLayout.findViewById(R.id.grid_image);
            this.gridImageLayout.f = false;
            GridImageLayout v0 = this.gridImageLayout;
            int v1 = this.mImageViewWidth;
            int v2 = this.mImageViewHeight;
            v0.h = v1;
            v0.i = v2;
            if ("组图".equals(this.mFeedItemBehavior.getCategoryName())) {
                v0 = this.gridImageLayout;
                v0.l = true;
                v0.d.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
            }

            if (this.mIsNightMode) {
                this.adaptGridImageLayoutNightMode();
            }
        }
    }

    protected final void initAbstractCommentLayout() {
        if (this.mAbstractCommentLayout == null) {
            this.mAbstractCommentLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.abstract_comment_stub)).inflate();
            if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                    UIUtils.setLayoutMargins(this.mAbstractCommentLayout, -3, -3, -3, ((int) UIUtils.dp2px(this.context, 6f)));
                } else {
                    UIUtils.setLayoutMargins(this.mAbstractCommentLayout, -3, -3, -3, ((int) UIUtils.dp2px(this.context, 7f)));
                }
            }

            this.mItemAbstract = this.mAbstractCommentLayout.findViewById(R.id.item_abstract);
            this.mCommentContent = this.mAbstractCommentLayout.findViewById(R.id.comment_content);
            this.mCommentLeftTip = this.mAbstractCommentLayout.findViewById(R.id.comment_left_tip);
            this.duplicatePressedRelativeLayout.addAffectView(this.mCommentContent);
            if (this.mIsNightMode) {
                this.adaptAbstractCommentLayoutNightMode();
            }

        }
    }

    final void adaptEntityLayoutNightMode() {
        if (this.mEntityLayout != null) {
            this.mEntityLayout.setBackgroundResource(R.drawable.rect_mian3xian1_selector);
            this.mEntityDesc.setTextColor(ContextCompat.getColorStateList(this.context, R.color.ssxinzi2_selector));
            this.mEntityDivider.setBackgroundResource(R.color.ssxinxian10);
            this.mEntityLike.setTextColor(ContextCompat.getColorStateList(this.context, R.color.ssxinzi3_selector));
            this.mEntityLike.setCompoundDrawablesWithIntrinsicBounds(R.drawable.gl, 0, 0, 0);
            this.mEntityArrow.setImageResource(R.drawable.like_arrow_textpage_selector);
        }
    }

    protected final void initMultiImageLayout() {
        if (this.mImage3ImageContainerView == null) {
            this.mImage3ImageContainerView = ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.multi_image_layout_stub)).inflate();
            this.mImage3FirstImageView = this.mImage3ImageContainerView.findViewById(R.id.item_image_0);
            this.mImage3SecondImageView = this.mImage3ImageContainerView.findViewById(R.id.item_image_1);
            this.mImage3ThirdImageView = this.mImage3ImageContainerView.findViewById(R.id.item_image_2);
            this.mImage3ImageViews = new AsyncImageView[3];
            this.mImage3ImageViews[0] = this.mImage3FirstImageView;
            this.mImage3ImageViews[1] = this.mImage3SecondImageView;
            this.mImage3ImageViews[2] = this.mImage3ThirdImageView;
            int length = mImage3ImageViews.length;
            for (int i = 0; i < length; ++i) {
                ViewGroup.LayoutParams lp = mImage3ImageViews[i].getLayoutParams();
                lp.width = this.mImageViewWidth;
                lp.height = this.mImageViewHeight;
            }

            if (this.mIsNightMode) {
                this.adaptImage3ImageNightMode();
            }
        }
    }

    protected final void initVideoSwitchInfosLayout() {
        if (this.mVideoSwitchInfosLayout == null) {
            this.mVideoSwitchInfosLayout = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.video_switch_infos_stub)).inflate();
            this.mHeadNameInfosLayout = this.mVideoSwitchInfosLayout.findViewById(R.id.head_name_infos);
            this.mSwitchAvatar = this.mHeadNameInfosLayout.findViewById(R.id.switch_avatar);
            this.mSwitchName = this.mHeadNameInfosLayout.findViewById(R.id.switch_name);
            this.mSwitchVideoDigg = this.mVideoSwitchInfosLayout.findViewById(R.id.switch_video_digg);
            this.mSwitchVideoBury = this.mVideoSwitchInfosLayout.findViewById(R.id.switch_video_bury);
            this.mSwitchVideoCommentCount = this.mVideoSwitchInfosLayout.findViewById(R.id.switch_video_comment_count);
            this.mSwitchVideoAction = this.mVideoSwitchInfosLayout.findViewById(R.id.switch_video_action);
            int v0 = UIUtils.percentWidth(this.context, 0.0427f);
            int v1 = ((int) UIUtils.dp2px(this.context, 15f));
            this.mSwitchVideoDigg.setPadding(v1, 0, v0, 0);
            this.mSwitchVideoBury.setPadding(v0, 0, v0, 0);
            this.mSwitchVideoCommentCount.setPadding(v0, 0, v0, 0);
            this.mSwitchVideoAction.setPadding(v0, 0, v1, 0);
            if (this.mIsNightMode) {
                this.R();
            }
        }
    }

    final void adaptVideoSwitchInfosLayoutNightMode() {
        if (this.mVideoSwitchSourceInfosLayout != null) {
            this.mVideoSwitchSourceInfosLayout.setBackgroundResource(R.color.switch_source_infos_bg);
            int v0 = ContextCompat.getColor(this.context, R.color.ssxinzi3);
            this.mSwitchSource.setTextColor(v0);
            this.mCommentCount.setTextColor(v0);
            this.mVideoDuration.setTextColor(v0);
        }
    }

    protected final void initTopSourceLayout() {
        if (this.mTopSourceLayout == null) {
            this.mTopSourceLayout = (LinearLayout) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.top_source_layout_stub)).inflate();
            if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                    UIUtils.setLayoutMargins(this.mTopSourceLayout, -3, ((int) UIUtils.dp2px(this.context, 5f)), -3, -3);
                } else {
                    UIUtils.setLayoutMargins(this.mTopSourceLayout, -3, ((int) UIUtils.dp2px(this.context, 6f)), -3, -3);
                }
            }

            this.mTopSourceIcon = this.mTopSourceLayout.findViewById(R.id.top_source_icon);
            this.mTopSourceIconTv = this.mTopSourceLayout.findViewById(R.id.top_source_icon_tv);
            this.mTopSourceIconTv.getPaint().setFakeBoldText(true);
            this.mTopSourceText = this.mTopSourceLayout.findViewById(R.id.top_source_text);
            if (!this.mIsNightMode) {
                return;
            }

            this.adaptTopSourceLayoutNightMode();
        }
    }

    private void adaptGridImageLayoutNightMode() {
        if (this.mGridImageLayout != null) {
            FeedCellStyleConfig.a(this.mGridLayoutTitle, this.resources.getColorStateList(R.color.item_text));
            this.gridImageLayout.b();
        }
    }

    private void R() {
        if (this.mVideoSwitchInfosLayout != null) {
            this.mVideoSwitchInfosLayout.setBackgroundResource(R.color.ssxinmian4);
            this.mSwitchAvatar.setColorFilter(this.colorFilter);
            this.mSwitchName.setTextColor(ContextCompat.getColorStateList(this.context, R.color.ssxinzi1));
            ColorStateList colorStateList = ContextCompat.getColorStateList(this.context, R.color.ssxinzi3);
            this.mSwitchVideoDigg.adaptNightMode(this.mIsNightMode);
            this.mSwitchVideoBury.adaptNightMode(this.mIsNightMode);
            this.mSwitchVideoCommentCount.setDrawableTop$4eb43225(ContextCompat.getDrawable(this.context, R.drawable.video_cover_comm_count));
            this.mSwitchVideoAction.setDrawableTop$4eb43225(ContextCompat.getDrawable(this.context, R.drawable.video_cover_comm_repost));
            this.mSwitchVideoCommentCount.a(colorStateList, true);
            this.mSwitchVideoAction.a(colorStateList, true);
        }
    }

    private void adaptTopSourceLayoutNightMode() {
        if (this.mTopSourceLayout != null) {
            this.mTopSourceIcon.setBackgroundResource(R.drawable.circle_mian3_solid);
            this.mTopSourceIcon.setForeGroundDrawable(ContextCompat.getDrawable(this.context, R.drawable.circle_xian1));
            this.mTopSourceIcon.setColorFilter(this.colorFilter);
            this.mTopSourceIconTv.setBackgroundResource(R.drawable.circle_solid_mian7);
            this.mTopSourceIconTv.setTextColor(ContextCompat.getColor(this.context, R.color.ssxinzi7));
            this.mTopSourceText.setTextColor(ContextCompat.getColor(this.context, R.color.ssxinzi3));
        }
    }

    public static CharSequence a(Context arg1, String arg2, int[] arg3) {
        return a(arg1, arg2, arg3, R.color.pe);
    }

    public static CharSequence a(Context arg8, String arg9, int[] arg10, int arg11) {
        int v0 = 20;
        if (arg9 != null && arg9.length() > 0 && arg10 != null && arg10.length > 0 && arg10.length % 2 == 0) {
            int v5 = arg9.length();
            int v1 = arg10.length;
            if (v1 <= v0) {
                v0 = v1;
            }

            int v3 = 0;
            SpannableString v1_1 = new SpannableString(((CharSequence) arg9));
            int v2 = 1;
            while (v2 < v0) {
                int v6 = arg10[v2 - 1];
                int v4 = arg10[v2];
                if (v6 < v3) {
                    return ((CharSequence) arg9);
                }

                if (v6 >= v5) {
                    return ((CharSequence) arg9);
                }

                if (v4 <= v6) {
                    return ((CharSequence) arg9);
                }

                if (v4 > v5) {
                    return ((CharSequence) arg9);
                }

                v1_1.setSpan(new ForegroundColorSpan(ContextCompat.getColor(arg8, arg11)), v6, v4, 33);
                v2 += 2;
                v3 = v4;
            }

            return v1_1;
        }
        return arg9;
    }

    public static void a(Context context, CellRef cellRef) {
        if (context != null && cellRef != null) {
            DBHelper dbHelper = DBHelper.getInstance(context);
            if (dbHelper != null) {
                long ts = System.currentTimeMillis();
                cellRef.appendReadTs(ts);
                if (cellRef.cellType == 0) {
                    Article article = cellRef.article;
                    if (article != null) {
                        article.clickTimestamp = ts;
                        dbHelper.syncReadTs(article);
                    }
                } else {
                    dbHelper.a(cellRef);
                }
            }
        }
    }

    public static void a(View arg0, View.OnClickListener arg1) {
        if (arg0 != null && arg1 != null) {
            arg0.setOnClickListener(arg1);
        }
    }

    protected void a(InfoLayout.Info arg4) {
        if (!this.mCellRef.f()) {
            String v0 = null;
            if (this.mCellRef.stickStyle > 0 && !android.support.design.a.isTextEmpty(this.mCellRef.stickLabel)) {
                v0 = this.mCellRef.stickLabel;
            } else if (!android.support.design.a.isTextEmpty(this.mCellRef.adLabel)) {
                v0 = this.mCellRef.adLabel;
            } else if (!android.support.design.a.isTextEmpty(this.mCellRef.label)) {
                v0 = this.mCellRef.label;
            }

            if (android.support.design.a.isTextEmpty(v0)) {
                return;
            }

            int v1 = this.mCellRef.labelStyle;
            arg4.a |= 32;
            arg4.c = v0;
            arg4.labelStyle = v1;
        }
    }

    protected void initWidthOrigin(BaseFeedViewHolder arg2) {
        this.duplicatePressedRelativeLayout = arg2.duplicatePressedRelativeLayout;
        this.mContentContainer = arg2.mContentContainer;
        this.mDeleteTextView = arg2.mDeleteTextView;
        this.mDivider = arg2.mDivider;
        this.mImage3Title = arg2.mImage3Title;
        this.mImage3InfoLayout = arg2.mImage3InfoLayout;
        this.mImage1InfoLayout = arg2.mImage1InfoLayout;
        this.mRightInfoLayoutGroup = arg2.mRightInfoLayoutGroup;
        this.mNewInfoLayoutStub = arg2.mNewInfoLayoutStub;
        this.mNewInfoLayout = arg2.mNewInfoLayout;
        this.mImage1Container = arg2.mImage1Container;
        this.mImage1Title = arg2.mImage1Title;
        this.mRightComment = arg2.mRightComment;
        this.mImage1ImageView = arg2.mImage1ImageView;
        this.mRightVideoTime = arg2.mRightVideoTime;
        this.mRelatedVideoContainer = arg2.mRelatedVideoContainer;
        this.mImage1LeftContainer = arg2.mImage1LeftContainer;
        this.mImage1RightContainer = arg2.mImage1RightContainer;
        this.mAbstractCommentLayout = arg2.mAbstractCommentLayout;
        this.mItemAbstract = arg2.mItemAbstract;
        this.mCommentContent = arg2.mCommentContent;
        this.mCommentLeftTip = arg2.mCommentLeftTip;
        this.mLargeImageLayout = arg2.mLargeImageLayout;
        this.mLargeImage = arg2.mLargeImage;
        this.mLargeImageVideoPlay = arg2.mLargeImageVideoPlay;
        this.mLargeImageVideoGrayArea = arg2.mLargeImageVideoGrayArea;
        this.mLargeVideoTime = arg2.mLargeVideoTime;
        this.mLargeButtonAd = arg2.mLargeButtonAd;
        this.mImage3ImageContainerView = arg2.mImage3ImageContainerView;
        this.mImage3FirstImageView = arg2.mImage3FirstImageView;
        this.mImage3SecondImageView = arg2.mImage3SecondImageView;
        this.mImage3ThirdImageView = arg2.mImage3ThirdImageView;
        this.mImage3ImageViews = arg2.mImage3ImageViews;
        this.mLargeImageAdInfoLayout = arg2.mLargeImageAdInfoLayout;
        this.mRightImageAdLayout = arg2.mRightImageAdLayout;
        this.mRightImageAdTitle = arg2.mRightImageAdTitle;
        this.mRightImageAdImage = arg2.mRightImageAdImage;
        this.mRightImageAdImageLayout = arg2.mRightImageAdImageLayout;
        this.mRightImageAdImageTagIcon = arg2.mRightImageAdImageTagIcon;
        this.mRightImageAdLayout_AdInfoLayout = arg2.mRightImageAdLayout_AdInfoLayout;
        this.mLargeImageAdInfoLayout_AdInfoLayout = arg2.mLargeImageAdInfoLayout_AdInfoLayout;
        this.mRightImageAdCreativityLayout = arg2.mRightImageAdCreativityLayout;
        this.mImage3ImageContainer = arg2.mImage3ImageContainer;
        this.mRightImageAdLayoutHolder = arg2.mRightImageAdLayoutHolder;
        this.mLargeImageAdInfoAdLayoutHolder = arg2.mLargeImageAdInfoAdLayoutHolder;
        this.mCreativityAdInfoLayoutHolder = arg2.mCreativityAdInfoLayoutHolder;
        this.mCreativityAdInfoLayout = arg2.mCreativityAdInfoLayout;
        this.mActionAdDivider = arg2.mActionAdDivider;
        this.mActionAdIcon = arg2.mActionAdIcon;
        this.mVideoCoverLayout = arg2.mVideoCoverLayout;
        this.mCoverDuration = arg2.mCoverDuration;
        this.mCoverPlayIcon = arg2.mCoverPlayIcon;
        this.mCoverSource = arg2.mCoverSource;
        this.mCoverTitle = arg2.mCoverTitle;
        this.mCoverTopShaow = arg2.mCoverTopShaow;
        this.mCoverBottomShaow = arg2.mCoverBottomShaow;
        this.mCoverButtonAd = arg2.mCoverButtonAd;
        this.mMoreCommentsDiggInfoLayoutHolder = arg2.mMoreCommentsDiggInfoLayoutHolder;
        this.gridImageLayout = arg2.gridImageLayout;
        this.mGridImageLayout = arg2.mGridImageLayout;
        this.mGridLayoutTitle = arg2.mGridLayoutTitle;
        this.mDiggLayout = arg2.mDiggLayout;
        this.mBuryLayout = arg2.mBuryLayout;
        this.mCoverActionCommentCount = arg2.mCoverActionCommentCount;
        this.mCoverActionReport = arg2.mCoverActionReport;
        this.mVideoSourceInNoDigg = arg2.mVideoSourceInNoDigg;
        this.mVideoDurationInNoDigg = arg2.mVideoDurationInNoDigg;
        this.mVideoCommentInNoDigg = arg2.mVideoCommentInNoDigg;
        this.mVideoRepostInNoDigg = arg2.mVideoRepostInNoDigg;
        this.mDiggInfoLayout = arg2.mDiggInfoLayout;
        this.mNoDiggInfoLayout = arg2.mNoDiggInfoLayout;
        this.mDiggAuthorVideoLayout = arg2.mDiggAuthorVideoLayout;
        this.mAuthorAvatarWrapper = arg2.mAuthorAvatarWrapper;
        this.mAuthorAvatar = arg2.mAuthorAvatar;
        this.mAuthorName = arg2.mAuthorName;
        this.mAuthorVideoDiggLayout = arg2.mAuthorVideoDiggLayout;
        this.mAuthorVideoBuryLayout = arg2.mAuthorVideoBuryLayout;
        this.mAuthorVideoWatchCount = arg2.mAuthorVideoWatchCount;
        this.mAuthorVideoCommentCount = arg2.mAuthorVideoCommentCount;
        this.mAuthorDivider = arg2.mAuthorDivider;
        this.mAuthorVideoAction = arg2.mAuthorVideoAction;
        this.mVideoSwitchInfosLayout = arg2.mVideoSwitchInfosLayout;
        this.mHeadNameInfosLayout = arg2.mHeadNameInfosLayout;
        this.mSwitchAvatar = arg2.mSwitchAvatar;
        this.mSwitchName = arg2.mSwitchName;
        this.mSwitchVideoDigg = arg2.mSwitchVideoDigg;
        this.mSwitchVideoBury = arg2.mSwitchVideoBury;
        this.mSwitchVideoCommentCount = arg2.mSwitchVideoCommentCount;
        this.mSwitchVideoAction = arg2.mSwitchVideoAction;
        this.mVideoSwitchSourceInfosLayout = arg2.mVideoSwitchSourceInfosLayout;
        this.mSwitchSource = arg2.mSwitchSource;
        this.mCommentCount = arg2.mCommentCount;
        this.mVideoDuration = arg2.mVideoDuration;
        this.mTopSourceLayout = arg2.mTopSourceLayout;
        this.mTopSourceIcon = arg2.mTopSourceIcon;
        this.mTopSourceIconTv = arg2.mTopSourceIconTv;
        this.mTopSourceText = arg2.mTopSourceText;
        this.mEntityLayout = arg2.mEntityLayout;
        this.mEntityDesc = arg2.mEntityDesc;
        this.mEntityDivider = arg2.mEntityDivider;
        this.mEntityLike = arg2.mEntityLike;
        this.mEntityArrow = arg2.mEntityArrow;
    }

    public final void a(CellRef cellRef, int position) {
        if (cellRef != null) {
            if (this.bindData) {
                Logger.throwException("status dirty ! This should not occur !");
                this.onMovedToScrapHeap();
            }

            this.bindData = true;
            this.mCellRef = cellRef;
            this.mPosition = position;
            if (this.mIsNightMode != AppData.isNightMode()) {
                this.mIsNightMode = AppData.isNightMode();
                if (foregroundColorSpan == null) {
                    foregroundColorSpan = new ForegroundColorSpan(ContextCompat.getColor(this.context, R.color.update_comment_more_text_selector));
                }

                this.colorFilter = this.mIsNightMode ? TTUtils.getNightModeColorFilter() : null;
                FeedCellStyleConfig.a(this.mImage3Title, this.resources.getColorStateList(R.color.item_text));
                ClickableBackgroundCompat.setClickableBackground(this.duplicatePressedRelativeLayout, this.mIsNightMode);
                this.mDivider.setBackgroundColor(ContextCompat.getColor(this.context, R.color.divider));
                if (!this.mCellRef.j()) {
                    InfoLayout.a();
                } else if (this.mNewInfoLayout != null) {
                    this.mNewInfoLayout.adaptNightMode();
                }

                this.adaptAbstractCommentLayoutNightMode();
                this.adaptRightTitleLayoutNightMode();
                this.adaptDiggInfoLayoutNightMode();
                this.adaptNoDiggInfoLayoutNightMode();
                this.adaptImage3ImageNightMode();
                this.adaptLargeImageLayoutNightMode();
                this.adaptVideoCoverLayoutNightMode();
                this.adaptLargeImageAdInfoLayoutNightMode();
                this.adaptRightImageAdLayoutNight();
                if (this.mRightImageAdCreativityLayout != null) {
                    this.mRightImageAdImage.setColorFilter(this.colorFilter);
                    FeedCellStyleConfig.a(this.mRightImageAdTitle, this.resources.getColorStateList(R.color.item_text));
                    this.m();
                }

                if (this.mImage3ImageContainerView != null) {
                    ((NightModeAsyncImageView) this.mImage3FirstImageView).adaptNightMode(this.mIsNightMode);
                    ((NightModeAsyncImageView) this.mImage3SecondImageView).adaptNightMode(this.mIsNightMode);
                    ((NightModeAsyncImageView) this.mImage3ThirdImageView).adaptNightMode(this.mIsNightMode);
                    this.m();
                }

                this.adaptMoreCommentsDiggInfoLayoutNightMode();
                this.adaptDiggAuthorVideoLayoutNightMode();
                this.adaptGridImageLayoutNightMode();
                this.adaptEntityLayoutNightMode();
                this.R();
                this.adaptVideoSwitchInfosLayoutNightMode();
                this.adaptTopSourceLayoutNightMode();
            }

            this.g();
            this.y();
            this.mContentContainer.getViewTreeObserver().addOnPreDrawListener(this.onPreDrawListener);
        }
    }

    protected void a_(boolean isDownload) {
        if (this.mAppAdInfoLayout != null) {
            this.mAdNameTv.setTextColor(ContextCompat.getColor(this.context, R.color.ssxinzi3));
            this.mAdDetailInfoTv.setTextColor(ContextCompat.getColor(this.context, R.color.cg));
            if (isDownload) {
                this.initAdDownloadProgress();
            }
        }
    }

    protected static void b(View arg1, int arg2) {
        ViewGroup.LayoutParams v0 = arg1.getLayoutParams();
        if (v0 != null) {
            if (arg2 > 0) {
                v0.height = arg2;
            }

            arg1.setLayoutParams(v0);
        }
    }

    public final void initImage3Layout(View itemView) {
        this.duplicatePressedRelativeLayout = itemView.findViewById(R.id.root);
        this.mContentContainer = itemView.findViewById(R.id.contents_wrapper);
        this.mDivider = itemView.findViewById(R.id.divider);
        this.mImage3Title = itemView.findViewById(R.id.title);
        FeedCellStyleConfig.a(this.mImage3Title, null);
        this.typeface = this.mImage3Title.getTypeface();
        this.mDeleteTextView = itemView.findViewById(R.id.delete);
        this.mImage3InfoLayout = itemView.findViewById(R.id.info_layout_group);
        if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
            if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                UIUtils.setLayoutMargins(this.mImage3Title, -3, ((int) UIUtils.dp2px(this.context, 10f)), -3, -3);
                UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, ((int) UIUtils.dp2px(this.context, 5f)), -3, ((int) UIUtils.dp2px(this.context, 6f)));
            } else {
                UIUtils.setLayoutMargins(this.mImage3Title, -3, ((int) UIUtils.dp2px(this.context, 12f)), -3, -3);
                UIUtils.setLayoutMargins(this.mImage3InfoLayout, -3, ((int) UIUtils.dp2px(this.context, 6f)), -3, ((int) UIUtils.dp2px(this.context, 7f)));
            }
        }

        this.mImage3InfoLayout.setSourceIconHeight(this.mSourceIconHeight);
        this.mImage3InfoLayout.setSourceIconMaxWidth(this.mSourceIconMaxWidth);
        this.mImage3InfoLayout.setCommonTxtPaintTypeFace(this.typeface);
        this.duplicatePressedRelativeLayout.setOnLongClickListener(null);
    }

    public final void initWithSomeOther(BaseFeedViewHolder baseFeedViewHolder) {
        this.mIsNightMode = baseFeedViewHolder.mIsNightMode;
        this.initWidthOrigin(baseFeedViewHolder);
    }

    protected void c(InfoLayout.Info arg2) {
        if (this.mCellRef.sourceIcon != null) {
            arg2.a |= 16;
            arg2.j = this.mCellRef.sourceIcon;
        } else {
            this.a(arg2);
        }
    }

    protected final void d(int arg8) {
        ViewGroup v2;
        AdLayoutHolder v1;
        AdLayoutHolder v0 = null;
        int v5 = R.dimen.f4;
        int v4 = R.dimen.f3;
        switch (arg8) {
            case 1: {
                v2 = this.mRightImageAdLayout_AdInfoLayout;
                v1 = this.mRightImageAdLayoutHolder;
                break;
            }
            case 2: {
                v2 = this.mLargeImageAdInfoLayout_AdInfoLayout;
                v1 = this.mLargeImageAdInfoAdLayoutHolder;
                break;
            }
            case 3: {
                v2 = this.mCreativityAdInfoLayout;
                v1 = this.mCreativityAdInfoLayoutHolder;
                break;
            }
            case 4: {
                v2 = this.mCreativityAdInfoLayout;
                v1 = this.mCreativityAdInfoLayoutHolder;
                break;
            }
            default: {
                v1 = v0;
                v2 = ((ViewGroup) null);
                break;
            }
        }

        if (v2 != null && v1 != null) {
            View actionAdInfoLayoutViewStub = v2.findViewById(R.id.action_ad_info_layout_viewstub);
            if (actionAdInfoLayoutViewStub != null) {
                this.mActionAdInfoLayout = (TextView) ((ViewStub) actionAdInfoLayoutViewStub).inflate();
                v1.mActionAdInfoLayout = this.mActionAdInfoLayout;
            } else {
                this.mActionAdInfoLayout = v1.mActionAdInfoLayout;
            }

            if (this.mActionAdInfoLayout == null) {
            } else {
                switch (arg8) {
                    case 1: {
                        this.mActionAdInfoLayout.setTextSize(15f);
                        break;
                    }
                    case 3:
                    case 4: {
                        v2.setBackgroundColor(ContextCompat.getColor(this.context, R.color.ssxinmian3));
                        LinearLayout.LayoutParams v0_2 = new LinearLayout.LayoutParams(-1, -2);
                        if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            v0_2.setMargins(this.context.getResources().getDimensionPixelOffset(v4),
                                    this.context.getResources().getDimensionPixelOffset(R.dimen.f5),
                                    this.context.getResources().getDimensionPixelOffset(v5),
                                    this.context.getResources().getDimensionPixelOffset(R.dimen.f2));
                        } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                            v0_2.setMargins(this.context.getResources().getDimensionPixelOffset(v4),
                                    ((int) UIUtils.dp2px(this.context, 5f)),
                                    this.context.getResources().getDimensionPixelOffset(v5),
                                    ((int) UIUtils.dp2px(this.context, 8f)));
                        } else {
                            v0_2.setMargins(this.context.getResources().getDimensionPixelOffset(v4),
                                    ((int) UIUtils.dp2px(this.context, 6f)),
                                    this.context.getResources().getDimensionPixelOffset(v5), ((int) UIUtils.dp2px(this.context, 9f)));
                        }

                        v2.setLayoutParams(((ViewGroup.LayoutParams) v0_2));
                        v2.setPadding(this.context.getResources().getDimensionPixelOffset(R.dimen.f7),
                                this.context.getResources().getDimensionPixelOffset(R.dimen.f9),
                                this.context.getResources().getDimensionPixelOffset(R.dimen.f8),
                                this.context.getResources().getDimensionPixelOffset(R.dimen.f6));
                        this.mActionAdInfoLayout.setTextColor(ContextCompat.getColor(this.context, R.color.ssxinzi3));
                        this.mActionAdInfoLayout.setTextSize(17f);
                        break;
                    }
                }
            }
        }
        this.h();
    }

    protected final void e(int arg10) {
        ViewGroup v0_1;
        ViewGroup v3;
        AdLayoutHolder v2;
        float v7 = 17f;
        int v6 = R.dimen.f4;
        int v5 = R.dimen.f3;
        AdLayoutHolder v1 = null;
        switch (arg10) {
            case 1: {
                v3 = this.mRightImageAdLayout_AdInfoLayout;
                v2 = this.mRightImageAdLayoutHolder;
                break;
            }
            case 2: {
                v3 = this.mLargeImageAdInfoLayout_AdInfoLayout;
                v2 = this.mLargeImageAdInfoAdLayoutHolder;
                break;
            }
            case 3:
            case 4: {
                v3 = this.mCreativityAdInfoLayout;
                v2 = this.mCreativityAdInfoLayoutHolder;
                break;
            }
            default: {
                v2 = v1;
                v3 = ((ViewGroup) null);
                break;
            }
        }

        if (v3 != null && v2 != null) {
            View adDownloadProgressLayoutViewStub = v3.findViewById(R.id.app_ad_info_layout_viewstub);
            if (adDownloadProgressLayoutViewStub != null) {
                this.mAppAdInfoLayout = (ViewGroup) ((ViewStub) adDownloadProgressLayoutViewStub).inflate();
                this.mAdNameTv = this.mAppAdInfoLayout.findViewById(R.id.ad_name_tv);
                this.mAdDetailInfoTv = this.mAppAdInfoLayout.findViewById(R.id.ad_detail_info_tv);
                v2.mAppAdInfoLayout = this.mAppAdInfoLayout;
                v2.mAdNameTv = this.mAdNameTv;
                v2.mAdDetailInfoTv = this.mAdDetailInfoTv;
            } else {
                this.mAppAdInfoLayout = v2.mAppAdInfoLayout;
                this.mAdNameTv = v2.mAdNameTv;
                this.mAdDetailInfoTv = v2.mAdDetailInfoTv;
            }

            switch (arg10) {
                case 1: {
                    v0_1 = this.mRightImageAdLayout_AdInfoLayout;
                    v1 = this.mRightImageAdLayoutHolder;
                    break;
                }
                case 2: {
                    v0_1 = this.mLargeImageAdInfoLayout_AdInfoLayout;
                    v1 = this.mLargeImageAdInfoAdLayoutHolder;
                    break;
                }
                case 3:
                case 4: {
                    v0_1 = this.mCreativityAdInfoLayout;
                    v1 = this.mCreativityAdInfoLayoutHolder;
                    break;
                }
                default: {
                    v0_1 = null;
                    break;
                }
            }

            if (v0_1 != null && v1 != null) {
                adDownloadProgressLayoutViewStub = v0_1.findViewById(R.id.ad_download_progress_layout_viewstub);
                if (adDownloadProgressLayoutViewStub != null) {
                    this.mAdDownloadProgressLayout = (ViewGroup) ((ViewStub) adDownloadProgressLayoutViewStub).inflate();
                    this.mAdDownloadSize = this.mAdDownloadProgressLayout.findViewById(R.id.ad_download_size);
                    this.mAdDownloadStatus = this.mAdDownloadProgressLayout.findViewById(R.id.ad_download_status);
                    this.mAdDownloadProgress = this.mAdDownloadProgressLayout.findViewById(R.id.ad_download_progress);
                    v1.mAdDownloadProgressLayout = this.mAdDownloadProgressLayout;
                    v1.mAdDownloadSize = this.mAdDownloadSize;
                    v1.mAdDownloadStatus = this.mAdDownloadStatus;
                    v1.mAdDownloadProgress = this.mAdDownloadProgress;
                } else {
                    this.mAdDownloadProgressLayout = v1.mAdDownloadProgressLayout;
                    this.mAdDownloadSize = v1.mAdDownloadSize;
                    this.mAdDownloadStatus = v1.mAdDownloadStatus;
                    this.mAdDownloadProgress = v1.mAdDownloadProgress;
                }
            }

            if (this.mAppAdInfoLayout == null) {
            } else {
                switch (arg10) {
                    case 1: {
                        label_203:
                        this.mAdNameTv.setTextSize(15f);
                        this.mAdDetailInfoTv.setTextSize(12f);
                        break;
                    }
                    case 3:
                    case 4: {
                        label_112:
                        v3.setBackgroundColor(ContextCompat.getColor(this.context, R.color.ssxinmian3));
                        LinearLayout.LayoutParams v0_2 = new LinearLayout.LayoutParams(-1, -2);
                        if (!this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                            v0_2.setMargins(this.context.getResources().getDimensionPixelOffset(v5),
                                    this.context.getResources().getDimensionPixelOffset(R.dimen.f5),
                                    this.context.getResources().getDimensionPixelOffset(v6),
                                    this.context.getResources().getDimensionPixelOffset(R.dimen.f2));
                        } else if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                            v0_2.setMargins(this.context.getResources().getDimensionPixelOffset(v5),
                                    ((int) UIUtils.dp2px(this.context, 5f)),
                                    this.context.getResources().getDimensionPixelOffset(v6), ((int) UIUtils.dp2px(this.context, 8f)));
                        } else {
                            v0_2.setMargins(this.context.getResources().getDimensionPixelOffset(v5),
                                    ((int) UIUtils.dp2px(this.context, 6f)),
                                    this.context.getResources().getDimensionPixelOffset(v6),
                                    ((int) UIUtils.dp2px(this.context, 9f)));
                        }

                        v3.setLayoutParams(((ViewGroup.LayoutParams) v0_2));
                        v3.setPadding(this.context.getResources().getDimensionPixelOffset(R.dimen.f7),
                                this.context.getResources().getDimensionPixelOffset(R.dimen.f9),
                                this.context.getResources().getDimensionPixelOffset(R.dimen.f8),
                                this.context.getResources().getDimensionPixelOffset(R.dimen.f6));
                        this.mAdNameTv.setTextColor(ContextCompat.getColor(this.context, R.color.ssxinzi3));
                        this.mAdNameTv.setTextSize(v7);
                        this.mAdDetailInfoTv.setTextSize(v7);
                        break;
                    }
                }
            }
        }
        this.a_(true);
    }

    protected final void f(int arg5) {
        AdLayoutHolder v1;
        ViewGroup v0 = null;
        switch (arg5) {
            case 1: {
                v0 = this.mRightImageAdLayout_AdInfoLayout;
                v1 = this.mRightImageAdLayoutHolder;
                break;
            }
            case 2: {
                v0 = this.mLargeImageAdInfoLayout_AdInfoLayout;
                v1 = this.mLargeImageAdInfoAdLayoutHolder;
                break;
            }
            default: {
                v1 = null;
                break;
            }
        }

        if (v0 != null && v1 != null) {
            View v0_1 = v0.findViewById(R.id.lbs_ad_info_layout_viewstub);
            if (v0_1 != null) {
                this.mLbsAdInfoLayout = (ViewGroup) ((ViewStub) v0_1).inflate();
                this.mLbsAdAddressInfoTv = this.mLbsAdInfoLayout.findViewById(R.id.lbs_ad_address_info_tv);
                this.mLbsAdOriginPriceTv = this.mLbsAdInfoLayout.findViewById(R.id.lbs_ad_origin_price_tv);
                this.mLbsAdSoldNumberTv = this.mLbsAdInfoLayout.findViewById(R.id.lbs_ad_sold_number_tv);
                this.mLbsAdCurrentPriceTv = this.mLbsAdInfoLayout.findViewById(R.id.lbs_ad_current_price_tv);
                v1.mLbsAdInfoLayout = this.mLbsAdInfoLayout;
                v1.mLbsAdAddressInfoTv = this.mLbsAdAddressInfoTv;
                v1.mLbsAdOriginPriceTv = this.mLbsAdOriginPriceTv;
                v1.mLbsAdSoldNumberTv = this.mLbsAdSoldNumberTv;
                v1.mLbsAdCurrentPriceTv = this.mLbsAdCurrentPriceTv;
            }
        }

        this.adaptLbsAdInfoLayoutNightMode();
    }

    protected void g() {
        int visibility = View.VISIBLE;
        if (this.mCellRef.j()) {
            if (this.mCellRef.l) {
                visibility = View.INVISIBLE;
            }
            mDivider.setVisibility(visibility);
        } else {
            if (this.mCellRef.l) {
                visibility = View.GONE;
            }
            mDivider.setVisibility(visibility);
        }

        this.mIsNightMode = AppData.isNightMode();
        this.colorFilter = this.mIsNightMode ? TTUtils.getNightModeColorFilter() : null;
    }

    protected final void g(int arg4) {
        ViewGroup v2;
        AdLayoutHolder v1;
        AdLayoutHolder v0 = null;
        switch (arg4) {
            case 1: {
                v2 = this.mRightImageAdLayout_AdInfoLayout;
                v1 = this.mRightImageAdLayoutHolder;
                break;
            }
            case 2: {
                v2 = this.mLargeImageAdInfoLayout_AdInfoLayout;
                v1 = this.mLargeImageAdInfoAdLayoutHolder;
                break;
            }
            case 3:
            case 4: {
                v2 = this.mCreativityAdInfoLayout;
                v1 = this.mCreativityAdInfoLayoutHolder;
                break;
            }
            default: {
                v1 = v0;
                v2 = null;
                break;
            }
        }

        if (v2 != null && v1 != null) {
            if (v1.mAdActionBtnLayout == null) {
                this.mAdActionBtnLayout = v2.findViewById(R.id.ad_action_btn_layout);
                this.mActionAdTv = v2.findViewById(R.id.action_ad_tv);
                this.mActionAdIcon = v2.findViewById(R.id.action_ad_icon);
                this.mActionAdProgress = v2.findViewById(R.id.action_ad_progress);
                this.mActionAdDivider = v2.findViewById(R.id.action_ad_divider);
                v1.mAdActionBtnLayout = this.mAdActionBtnLayout;
                v1.mActionAdTv = this.mActionAdTv;
                v1.mActionAdIcon = this.mActionAdIcon;
                v1.mActionAdProgress = this.mActionAdProgress;
                v1.mActionAdDivider = this.mActionAdDivider;
            } else {
                this.mAdActionBtnLayout = v1.mAdActionBtnLayout;
                this.mActionAdTv = v1.mActionAdTv;
                this.mActionAdIcon = v1.mActionAdIcon;
                this.mActionAdProgress = v1.mActionAdProgress;
                this.mActionAdDivider = v1.mActionAdDivider;
            }
        }

        this.adaptAdActionBtnLayoutNightMode();
    }

    protected final void g(InfoLayout.Info info) {
        int v0;
        switch (this.mFeedType) {
            case 1:
            case 3: {
                v0 = 1;
                break;
            }
            default: {
                v0 = 0;
                break;
            }
        }

        if (v0 != 0) {
            info.a |= 64;
        }
    }

    protected void h() {
        if (this.mActionAdInfoLayout != null) {
            this.mActionAdInfoLayout.setTextColor(ContextCompat.getColor(this.context, R.color.ssxinzi3));
        }

        if (this.mActionAdProgress != null) {
            this.mActionAdProgress.setProgressDrawable(this.resources.getDrawable(R.drawable.action_ad_progress_bar_horizontal));
            this.mActionAdProgress.getProgressDrawable().setBounds(this.mActionAdProgress.getProgressDrawable().getBounds());
        }
    }

    protected final void h(InfoLayout.Info info) {
        if (this.mCellRef.m()) {
            info.a |= 8;
            info.f = this.timeFormatter.a(this.mCellRef.cateBehotTime * 1000);
        }
    }

    protected void adaptAdActionBtnLayoutNightMode() {
        if (this.mAdActionBtnLayout != null) {
            this.mAdActionBtnLayout.setBackgroundResource(R.drawable.ad_action_btn_begin_bg);
            if (this.mActionAdTv != null) {
                this.mActionAdTv.setTextColor(this.resources.getColorStateList(R.color.ad_action_btn_begin_text_color));
            }

            if (this.mActionAdDivider != null) {
                this.mActionAdDivider.setBackgroundResource(R.color.ssxinxian1);
            }

            if (this.mActionAdIcon == null) {
                return;
            }
            this.mActionAdIcon.setImageResource(R.drawable.callicon_ad_textpage);
        }
    }

    private void adaptLargeImageLayoutNightMode() {
        if (this.mLargeImageLayout != null) {
            ((NightModeAsyncImageView) this.mLargeImage).adaptNightMode(this.mIsNightMode);
            this.mLargeImageVideoPlay.setImageResource(R.drawable.playicon_video_selector);
            this.mLargeImageVideoGrayArea.setBackgroundResource(R.color.ssxinmian3);
            UIUtils.setBackgroundResource(this.mLargeVideoTime, R.drawable.video_time_length_bg);
            this.mLargeVideoTime.a(ContextCompat.getColorStateList(this.context, R.color.ssxinzi12), false);
            this.mLargeVideoTime.setDrawable(ContextCompat.getDrawable(this.context, R.drawable.palyicon_video_textpage), false);
            this.mLargeVideoTime.setBackgroundResource(R.drawable.video_time_length_bg);
            this.mLargeButtonAd.b(this.mIsNightMode);
            this.mLargeImageVideoGrayArea.b(this.mIsNightMode);
        }
    }

    protected void k() {
        int v9 = -3;
        float v8 = 8f;
        float v7 = 10f;
        if (this.mImage1Container == null) {
            this.mImage1Container = (ViewGroup) ((ViewStub) this.duplicatePressedRelativeLayout.findViewById(R.id.right_title_layout_stub)).inflate();
            this.mImage1Title = this.mImage1Container.findViewById(R.id.right_title);
            FeedCellStyleConfig.a(this.mImage1Title, null);
            this.mImage1LeftContainer = this.mImage1Container.findViewById(R.id.right_contents_wrapper);
            this.mImage1RightContainer = this.mImage1Container.findViewById(R.id.right_pic_wrapper);
            this.mImage1ImageView = this.mImage1Container.findViewById(R.id.right_pic);
            this.mRightVideoTime = this.mImage1Container.findViewById(R.id.right_video_time);
            this.mRightComment = this.mImage1Container.findViewById(R.id.right_comment);
            this.mRightVideoTime.a();
            this.mImage1InfoLayout = this.mImage1Container.findViewById(R.id.right_info_layout_group);
            this.mImage1InfoLayout.setSourceIconHeight(this.mSourceIconHeight);
            this.mImage1InfoLayout.setSourceIconMaxWidth(this.mSourceIconMaxWidth);
            this.mImage1InfoLayout.setCommonTxtPaintTypeFace(this.typeface);
            this.mImage1InfoLayout.mDislikeIcon.setId(R.id.ay);
            ViewGroup.LayoutParams image1RightContainerLp = this.mImage1RightContainer.getLayoutParams();
            ViewGroup.LayoutParams image1LeftContainerLp = this.mImage1LeftContainer.getLayoutParams();
            ViewGroup.LayoutParams image1TitleLp = this.mImage1Title.getLayoutParams();
            ViewGroup.LayoutParams v3 = this.mRightComment.getLayoutParams();
            ViewGroup.LayoutParams image1InfoLayoutLp = this.mImage1InfoLayout.getLayoutParams();
            if (this.mAppData.getAppSettings().isSingleImageGravityChange()) {
                ((RelativeLayout.LayoutParams) image1RightContainerLp).addRule(RelativeLayout.ALIGN_PARENT_LEFT);
                ((RelativeLayout.LayoutParams) image1LeftContainerLp).addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
                ((RelativeLayout.LayoutParams) image1LeftContainerLp).addRule(RelativeLayout.RIGHT_OF, R.id.right_pic_wrapper);
                ((LinearLayout.LayoutParams) image1TitleLp).setMargins(((int) UIUtils.dp2px(this.context, v7)), 0, 0, 0);
                this.mImage1Title.setLayoutParams(image1TitleLp);
                ((LinearLayout.LayoutParams) v3).setMargins(((int) UIUtils.dp2px(this.context, v7)), ((int) UIUtils.dp2px(this.context, v8)), 0, 0);
                this.mRightComment.setLayoutParams(v3);
                ((LinearLayout.LayoutParams) image1InfoLayoutLp).setMargins(((int) UIUtils.dp2px(this.context, v7)), ((int) UIUtils.dp2px(this.context, 14f)), 0, 0);
                this.mImage1InfoLayout.setLayoutParams(image1InfoLayoutLp);
            } else {
                ((RelativeLayout.LayoutParams) image1RightContainerLp).addRule(11);
                ((RelativeLayout.LayoutParams) image1LeftContainerLp).addRule(9);
                ((RelativeLayout.LayoutParams) image1LeftContainerLp).addRule(0, R.id.right_pic_wrapper);
                ((LinearLayout.LayoutParams) image1TitleLp).setMargins(0, 0, ((int) UIUtils.dp2px(this.context, v8)), 0);
                this.mImage1Title.setLayoutParams(image1TitleLp);
                ((LinearLayout.LayoutParams) v3).setMargins(0, ((int) UIUtils.dp2px(this.context, v8)), ((int) UIUtils.dp2px(this.context, v7)), 0);
                this.mRightComment.setLayoutParams(v3);
                ((LinearLayout.LayoutParams) image1InfoLayoutLp).setMargins(0, ((int) UIUtils.dp2px(this.context, 14f)), ((int) UIUtils.dp2px(this.context, 20f)), 0);
                this.mImage1InfoLayout.setLayoutParams(image1InfoLayoutLp);
            }

            if (this.mAppData.getAppSettings().isFeedCellSpacingChange()) {
                if (this.mAppData.getAppSettings().isMaxCellSpacingChange()) {
                    UIUtils.setLayoutMargins(this.mImage1Container, v9, ((int) UIUtils.dp2px(this.context, v8)), v9, ((int) UIUtils.dp2px(this.context, v8)));
                } else {
                    UIUtils.setLayoutMargins(this.mImage1Container, v9, ((int) UIUtils.dp2px(this.context, v7)), v9, ((int) UIUtils.dp2px(this.context, v7)));
                }
            }

            if (!this.mIsNightMode) {
                return;
            }

            this.adaptRightTitleLayoutNightMode();
        }
    }

    public void onMovedToScrapHeap() {
        this.bindData = false;
        this.mContentContainer.getViewTreeObserver().removeOnPreDrawListener(this.onPreDrawListener);
        this.mContentContainer.setTouchDelegate(null);
        if (this.mNewInfoLayout != null) {
            this.mNewInfoLayout.b();
            this.mNewInfoLayout.setVisibility(View.GONE);
        }
    }

    private void adaptLargeImageAdInfoLayoutNightMode() {
        if (this.mLargeImageAdInfoLayout != null) {
            if (this.mLargeImage != null) {
                this.mLargeImage.setColorFilter(this.colorFilter);
            }
            UIUtils.setBackgroundResource(this.mLargeImageAdInfoLayout, R.drawable.large_image_ad_info_layout_bg);
            this.m();
        }
    }

    private void m() {
        this.h();
        this.a_(true);
        this.adaptLbsAdInfoLayoutNightMode();
        this.adaptAdActionBtnLayoutNightMode();
    }

    private void adaptImage3ImageNightMode() {
        if (this.mImage3ImageContainerView != null) {
            ((NightModeAsyncImageView) this.mImage3FirstImageView).adaptNightMode(this.mIsNightMode);
            ((NightModeAsyncImageView) this.mImage3SecondImageView).adaptNightMode(this.mIsNightMode);
            ((NightModeAsyncImageView) this.mImage3ThirdImageView).adaptNightMode(this.mIsNightMode);
        }
    }

    private void adaptRightTitleLayoutNightMode() {
        if (this.mImage1Container != null) {
            FeedCellStyleConfig.a(this.mImage1Title, this.resources.getColorStateList(R.color.item_text));
            UIUtils.setBackgroundResource(this.mRightVideoTime, R.drawable.video_time_length_bg);
            this.mRightVideoTime.a(ContextCompat.getColorStateList(this.context, R.color.ssxinzi12), false);
            this.mRightVideoTime.setDrawable(ContextCompat.getDrawable(this.context, R.drawable.palyicon_video_textpage), false);
            this.mRightVideoTime.setBackgroundResource(R.drawable.video_time_length_bg);
            ((NightModeAsyncImageView) this.mImage1ImageView).adaptNightMode(this.mIsNightMode);
            InfoLayout.a();
        }
    }

    private void adaptAbstractCommentLayoutNightMode() {
        if (this.mAbstractCommentLayout != null) {
            this.mItemAbstract.setTextColor(ContextCompat.getColor(this.context, R.color.ssxinzi3));
            this.mCommentContent.setTextColor(this.resources.getColor(R.color.zzcomment_text));
        }
    }

    private void adaptDiggAuthorVideoLayoutNightMode() {
        if (this.mDiggAuthorVideoLayout != null) {
            this.mAuthorAvatar.setColorFilter(this.colorFilter);
            this.mAuthorVideoDiggLayout.adaptNightMode(this.mIsNightMode);
            this.mAuthorVideoBuryLayout.adaptNightMode(this.mIsNightMode);
            this.mAuthorVideoCommentCount.setTextColor(ContextCompat.getColorStateList(this.context, R.color.video_comments_info));
            this.mAuthorVideoCommentCount.setCompoundDrawablesWithIntrinsicBounds(R.drawable.video_cover_comm_count, 0, 0, 0);
            this.mAuthorDivider.setBackgroundResource(R.color.ssxinxian1);
            this.mAuthorVideoWatchCount.setTextColor(ContextCompat.getColor(this.context, R.color.ssxinzi3_selector));
        }
    }

    protected void initAdDownloadProgress() {
        if (this.mAdDownloadProgressLayout != null) {
            int textColor = ContextCompat.getColor(this.context, R.color.ssxinzi3);
            this.mAdDownloadSize.setTextColor(textColor);
            this.mAdDownloadStatus.setTextColor(textColor);
            this.mAdDownloadProgress.setProgressDrawable(this.resources.getDrawable(R.drawable.ad_download_progress_bar_horizontal));
            this.mAdDownloadProgress.getProgressDrawable().setBounds(this.mAdDownloadProgress.getProgressDrawable().getBounds());
        }
    }

    private void adaptVideoCoverLayoutNightMode() {
        if (this.mVideoCoverLayout != null) {
            this.mCoverTitle.setTextColor(ContextCompat.getColor(this.context, R.color.article_video_cover_txt_color));
            this.mCoverSource.setTextColor(ContextCompat.getColor(this.context, R.color.article_video_cover_txt_color));
            this.mCoverDuration.a(ContextCompat.getColorStateList(this.context, R.color.ssxinzi12), false);
            this.mCoverDuration.setBackgroundResource(R.drawable.video_time_length_bg);
            this.mCoverPlayIcon.setImageResource(R.drawable.playicon_video_selector);
            this.mCoverTopShaow.setBackgroundResource(R.drawable.thr_shadow_video);
            this.mCoverBottomShaow.setBackgroundResource(R.drawable.two_shadow_video);
            this.mVideoCoverLayout.setBackgroundColor(ContextCompat.getColor(this.context, R.color.video_cover_layout_background));
            this.mCoverButtonAd.b(this.mIsNightMode);
        }
    }

    private void adaptLbsAdInfoLayoutNightMode() {
        if (this.mLbsAdInfoLayout != null) {
            int color = ContextCompat.getColor(this.context, R.color.ssxinzi3);
            this.mLbsAdAddressInfoTv.setTextColor(color);
            this.mLbsAdOriginPriceTv.setTextColor(color);
            this.mLbsAdSoldNumberTv.setTextColor(color);
            this.mLbsAdCurrentPriceTv.setTextColor(ContextCompat.getColor(this.context, R.color.ssxinzi4));
        }
    }

    protected void adaptRightImageAdLayoutNight() {
        if (this.mRightImageAdLayout != null) {
            this.mRightImageAdImage.setColorFilter(this.colorFilter);
            FeedCellStyleConfig.a(this.mRightImageAdTitle, this.resources.getColorStateList(R.color.item_text));
            this.m();
        }
    }

    final void adaptDiggInfoLayoutNightMode() {
        if (this.mDiggInfoLayout != null) {
            this.mDiggInfoLayout.setBackgroundColor(ContextCompat.getColor(this.context, R.color.ssxinmian4));
            this.mDiggLayout.adaptNightMode(this.mIsNightMode);
            this.mBuryLayout.adaptNightMode(this.mIsNightMode);
            this.mCoverActionCommentCount.setCompoundDrawablesWithIntrinsicBounds(R.drawable.video_cover_comm_count, 0, 0, 0);
            this.mCoverActionCommentCount.setTextColor(this.context.getResources().getColorStateList(R.color.video_comments_info));
            this.mCoverActionReport.setImageResource(R.drawable.video_cover_comm_repost);
        }
    }

    final void adaptMoreCommentsDiggInfoLayoutNightMode() {
        if (this.mMoreCommentsDiggInfoLayoutHolder != null) {
            mMoreCommentsDiggInfoLayoutHolder.mMoreCommentsDiggInfoLayout.setBackgroundColor(ContextCompat.getColor(context, R.color.ssxinmian4));
            FeedCellStyleConfig.a(mMoreCommentsDiggInfoLayoutHolder.mVideoTitle, context.getResources().getColorStateList(R.color.item_text));
            mMoreCommentsDiggInfoLayoutHolder.mDividerLine.setBackgroundColor(ContextCompat.getColor(context, R.color.ssxinxian7));
            mMoreCommentsDiggInfoLayoutHolder.mDividerSpace.setBackgroundColor(ContextCompat.getColor(context, R.color.ssxinmian2));
            mMoreCommentsDiggInfoLayoutHolder.mMultiVideoDiggLayout.adaptNightMode(mIsNightMode);
            mMoreCommentsDiggInfoLayoutHolder.mMultiVideoBuryLayout.adaptNightMode(mIsNightMode);
            mMoreCommentsDiggInfoLayoutHolder.mComment.setCompoundDrawablesWithIntrinsicBounds(R.drawable.video_cover_comm_count, 0, 0, 0);
            mMoreCommentsDiggInfoLayoutHolder.mComment.setTextColor(context.getResources().getColorStateList(R.color.video_comments_info));
            mMoreCommentsDiggInfoLayoutHolder.mMore.setImageResource(R.drawable.more_video_selector);
        }
    }

    final void adaptNoDiggInfoLayoutNightMode() {
        if (this.mNoDiggInfoLayout != null) {
            Resources resources = this.context.getResources();
            this.mNoDiggInfoLayout.setBackgroundColor(ContextCompat.getColor(this.context, R.color.ssxinmian4));
            this.mVideoCommentInNoDigg.setCompoundDrawablesWithIntrinsicBounds(R.drawable.video_cover_comm_count, 0, 0, 0);
            this.mVideoRepostInNoDigg.setImageResource(R.drawable.video_cover_comm_repost);
            this.mVideoSourceInNoDigg.setTextColor(resources.getColorStateList(R.color.video_comments_info));
            this.mVideoDurationInNoDigg.setTextColor(resources.getColorStateList(R.color.video_comments_info));
            this.mVideoCommentInNoDigg.setTextColor(resources.getColorStateList(R.color.video_comments_info));
        }
    }

    protected final void y() {
        int v0 = this.mAppData.mFontSizePref;
        if (v0 < 0 || v0 > 3) {
            v0 = 0;
        }

        int v1 = ArticleConstants.G[v0];
        if (this.mCellRef.j()) {
            v1 = ArticleConstants.H[v0];
        }

        FeedCellStyleConfig.setTextSize(this.mImage3Title, v1);
        FeedCellStyleConfig.setTextSize(this.mImage1Title, v1);
        FeedCellStyleConfig.setTextSize(this.mRightImageAdTitle, v1);
        FeedCellStyleConfig.setTextSize(this.mGridLayoutTitle, v1);
        if (this.mItemAbstract != null) {
            this.mItemAbstract.setTextSize(((float) ArticleConstants.I[v0]));
        }

        if (this.mCommentContent != null) {
            this.mCommentContent.setTextSize(((float) ArticleConstants.N[v0]));
        }
    }

    protected final boolean z() {
        switch (this.mFeedType) {
            case 1:
                return true;
            default:
                return false;
        }
    }
}

